package com.cj.mainmodule.repo

import com.cj.netlibrary.retrofit.RetrofitWithCoroutineManager
import com.cj.netlibrary.retrofit.RetrofitWithRxjava2Manager
import com.cj.mainmodule.bean.BaseRes
import com.cj.mainmodule.bean.ThePublicInfo
import com.cj.mainmodule.repo.coroutine.ServiceInterface
import com.cj.mainmodule.repo.observable.ApiService
import io.reactivex.Observable

/**
 *created by chen jun
 *on 2021/5/24 18:23
 */
object RepoManager {
    fun getChapters(): Observable<BaseRes<List<ThePublicInfo>>> {
        return RetrofitWithRxjava2Manager
                  .createApiService(ApiService::class.java)
                  .getChapters()
    }

    suspend fun getChapters1(): BaseRes<List<ThePublicInfo>> {
        return RetrofitWithCoroutineManager
            .createServiceInterface(ServiceInterface::class.java)
            .getChapters()
    }

}